package com.gress.shop.util;
import com.gress.shop.bo.Menu;

import java.util.Comparator;

/**
 * 用于菜单排序，构建菜单
 * Created by xiongwen on 2017/9/5.
 */
public class MyMenuComparator implements Comparator {

    @Override
    public int compare(Object o1, Object o2) {
        Menu module1 = (Menu) o1;
        Menu module2 = (Menu) o2;
        if (module1.getSortCode()> module2.getSortCode()){
            return 1;
        }
        if (module1.getSortCode()< module2.getSortCode()){
            return -1;
        }
        return 0;
    }
}